﻿using System;
using System.Web;
using System.Web.UI;
using System.IO;

namespace RN.ERP.Web.Person
{
    public partial class PersonUploadFile : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Initial();
            }
        }
        /// <summary>
        /// 取得参数初始化
        /// </summary>
        private void Initial()
        {
            if (Request.QueryString["filename"] == null)
            {
                Manager1.RadAlert("文件名不能为空！", 300, 150, "提示", "");
                return;
            }
            if (Request.QueryString["filename"] != null)
            {
                ucCutUpload.FileName = Request.Params["filename"].Trim();
            }
            if (Request.QueryString["SysCode"] != null)
            {
                ucCutUpload.SysCode = Request.Params["SysCode"].Trim();
            }
            if (Request.QueryString["FuncCode"] != null)
            {
                ucCutUpload.FuncCode = Request.Params["FuncCode"].Trim();
            }
            if (Request.QueryString["AspectRatio"] != null)
            {
                ucCutUpload.AspectRatio = Request.QueryString["AspectRatio"].Trim();
            }
            if (Request.QueryString["MaxSize"] != null)
            {
                int maxSize = 0;
                if (int.TryParse(Request.QueryString["MaxSize"].Trim(), out maxSize))
                {
                    ucCutUpload.MaxSize = maxSize;
                }
            }
        }
    }
}